<template>
  <div class="query">
    <div class="content">
      <h3>查询条件</h3>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="角色">
          <el-select v-model="formInline.rid" placeholder="选择角色">
            <el-option
              v-for="item in datas"
              :key="item.id"
              :label="item.roleName"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input v-model="formInline.name" placeholder="请输入姓名"></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input v-model="formInline.phone" placeholder="请输入电话"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button  @click="reSet"><i class="el-icon-refresh"></i>重置</el-button>
          <el-button type="primary" @click="onSubmit"><i class="el-icon-search"></i>查询</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: "body",
  created() {
    this.axios.get("micro-sys-server/role/all").then( res => {

      this.datas = res.data.data

    });
  },
  data(){
    return {
      formInline: {
        name: '',
        phone:''
      },
      datas: []
    }
  },
  methods :{
    onSubmit() {
      console.log(this.formInline);
    },
    reSet(){
      this.formInline = {}
    }
  }
}
</script>

<style scoped>
  .query{
    height: 120px;
    border: 1px solid white;
    width: 96%;
    margin: auto;
    padding-left: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
    background-color: white;
  }
</style>
